/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.farent.solutions.plugins.stripes.hyperstripes.core;

/**
 *
 * @author user
 */
public interface ComponentIdVendor
{
    /**<p>Generate an identifier for a component.
     * Optionally, a unique prefferedId value can
     * be supplied by component creators which will be used as the prefferedId.</p>
     *
     * @param prefferedId an optional value to dictate what the unique Id should be
     * @return a unique-id in the view tree
     */
    String createUniqueId(String prefferedId);

    /**
     * creates an Id for this component based on its Position in the view tree.
     * The id is unique within the context of the components immediate parent.
     * This ID will generally be of the form this.getParent().getId():this.getId()
     *
     * Its therefore important to call the createUniqueId() before this call to ensure a unique Id
     * ha been correctly created for the component
     *
     * @param model
     * @return a unique-ID for this component within its parent.
     */
    String createComponentId( ComponentModel model );
}
